 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
  package com.viettel.core.enumtype;
  import java.util.HashMap;
  import java.util.Map;
  /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 11:34:02
   */
  public enum ArticleStatus {
      
  	  DELETED(-1), //xoa
      HIDE (0), //an
      VISIBLE (1), //hien thi
  	  HOT (2), //hien thi
  	  PENDING (3), //cho phe duyet
  	  EDITING (4), //dang soan thao
  	  REFUSED (5); //bi tu choi
      /** The value. */
      private Integer value;
      
      /** The values. */
      private static Map<Integer, ArticleStatus> values = null;
      
      /**
       * Gets the value.
       * 
       * @return the value
       */
      public Integer getValue() {
          return value;
      }
      
      /**
       * Instantiates a new gender type.
       * 
       * @param value
       *            the value
       */
      ArticleStatus(Integer value) {
          this.value = value;
      }
      
      /**
       * Parses the value.
       * 
       * @param value
       *            the value
       * @return the gender type
       */
      public static ArticleStatus parseValue(Integer value) {
      	if (value != null && value == -1){
      		value = -1;
      	}    		
          if (values == null) {
              values = new HashMap<Integer, ArticleStatus>(
                      ArticleStatus.values().length);
              for (ArticleStatus e : ArticleStatus.values())
                  values.put(e.getValue(), e);
          }
          return values.get(value);
      }
  }
 
